import {Component, Input, OnInit} from '@angular/core';
import {StudentService} from "../student.service";
import {Student} from "../student";

@Component({
  selector: 'app-student-detail',
  templateUrl: './student-detail.component.html',
  styleUrls: ['./student-detail.component.css']
})
export class StudentDetailComponent implements OnInit {

  constructor(private studentService:StudentService) { }
  @Input()student:Student={
    id:-1,
    name:"请输入名字",
    sex:"男",
    tel:"电话",
    degree:"",
    born:"出生",
    addr:"地址"
  };
  ngOnInit() {
  }
  onSave(){
    this.studentService.save(this.student)
  }
}
